package com.example.flower_shop.config;

import cn.dev33.satoken.stp.StpInterface;
import com.example.flower_shop.service.usr.AuthService;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;

import java.util.List;

/**
 * satoken 权限配置、
 */
@Configuration
public class StpInterfaceImpl implements StpInterface {

    @Resource
    private AuthService authService;

    @Override
    public List<String> getPermissionList(Object loginId, String loginType) {
        return authService.getPerm();
    }

    @Override
    public List<String> getRoleList(Object loginId, String loginType) {
        return authService.getRoles();
    }
}
